package com.itheima.night.demo01;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

//Executors默认线程池
public class NewCachedThreadPoolDemo {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName() + "在执行了！");
        });

        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName() + "在执行了！");
        });
        executorService.shutdown();
    }
}
